package top.wettis.chat.controller;
import cn.dev33.satoken.stp.StpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.wettis.chat.constant.ResultType;
import top.wettis.chat.pojo.DO.Task;
import top.wettis.chat.pojo.VO.Result;
import top.wettis.chat.service.ITaskService;

import java.util.List;
/**
 * <p>
 * 任务表 前端控制器
 * </p>
 *
 * @author wettis
 * @since 2023-03-25
 */
@RestController
@CrossOrigin
@RequestMapping("/chat")
public class TaskController {
    @Autowired
    private ITaskService iTaskService;
    @GetMapping("/querytask")
    public Result<Object> getState(){
        int id = StpUtil.getLoginIdAsInt();
        List<Task> list = iTaskService.select(id);
        return Result.successInfo(ResultType.GET , list);
    }
}
